﻿Public Class frm_bon

    Private Sub frm_bon_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If bon = "liste demande" Then
            Dim crys As New CrystalBon
            crys.SetDataSource(dse)
            Dim str As String = id_event.ToString
            For i As Integer = id_event.ToString.Length To 7
                str = "0" & str
            Next
            crys.SetParameterValue("Num_Bon", str)
            CrystalReportViewer1.ReportSource = crys
            CrystalReportViewer1.Refresh()
        ElseIf bon = "liste loc" Then
            Dim crys As New CrystalBon_Loc
            crys.SetDataSource(dse)
            Dim str As String = id_loc.ToString
            For i As Integer = id_loc.ToString.Length To 7
                str = "0" & str
            Next
            crys.SetParameterValue("Num_Bon", str)
            CrystalReportViewer1.ReportSource = crys
            CrystalReportViewer1.Refresh()
        End If
       
    End Sub
End Class